package com.leftshine.dnstest.NetworkUtils;

import android.content.Context;
import android.os.Build;

import com.leftshine.dnstest.BuildConfig;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class DeviceUtil {

    // todo:https://rain9155.github.io/2019/07/12/%E5%A6%82%E4%BD%95%E8%8E%B7%E5%8F%96Android%E5%BA%94%E7%94%A8%E4%B8%8E%E7%B3%BB%E7%BB%9F%E4%BF%A1%E6%81%AF/

    public static String getDeviceInfo(Context context) {
        StringBuffer sb = new StringBuffer();
        sb.append(Build.BOARD + " ");
        sb.append(Build.BRAND + " ");
        sb.append(Build.DEVICE + " ");
        sb.append(Build.MANUFACTURER + " ");
        sb.append(Build.MODEL + " ");
        sb.append(Build.HARDWARE + " ");
        sb.append(Build.TAGS + "\n");
        sb.append(Build.VERSION.CODENAME + " ");
        sb.append(Build.VERSION.INCREMENTAL + " ");
        sb.append(Build.VERSION.RELEASE + " ");
        sb.append(Build.VERSION.SDK_INT + " ");
        sb.append(Build.HOST + " ");
        sb.append(Build.USER + " ");
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss", Locale.US);
        Date date= new Date(Build.TIME);
        sb.append(format.format(date)+ " ");
        return sb.toString();
    }
}
